#include <QtGui/QApplication>
#include <QDesktopWidget>
#include "ClientForm.h"
#include "Logger.h"

/*
*Centralize widget
*/
void center(QWidget &widget)
{

        int x, y;
        int screenWidth, screenHeight;
        int width= 600;
        int height = 500;

        QDesktopWidget *desktop = QApplication::desktop();

        screenWidth = desktop->width();
        screenHeight = desktop->height();

        x = (screenWidth - width) / 2;
        y = (screenHeight - height) / 2;

        widget.setGeometry(x, y, width, height);
        widget.setFixedSize(width, height);
}

int main(int argc, char *argv[])
{
	Logger::init("client.log");
    QApplication a(argc, argv);
    ClientForm w;
    center(w);
    w.show();
    return a.exec();
}
